Skip to content

Conversation

@anuraaga
Copy link
Collaborator

gunicorn continues to be flaky so I did some more investigating of the sync server code to see if anything stands out. I realized that the log spam we see on client disconnect is because of yielding in a finally block which will run even on exit. It was better to not use finally to make sure we only yield a final message on normal exceptions, not BaseException.

That doesn't fix flakiness but just removes the log spam, in the end I realized I had tried many different low and high values for keep-alive but never tried disabling it. I think it may be more stable with it disabled, and then went back to the more lightweight worker class. We'll see how this goes, but worst case is it's still as flaky as now. Will see how it goes, and as a last resort allow failures to unblock CI in the future since we have other servers to verify with.

Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
@anuraaga anuraaga requested a review from a team January 21, 2026 04:23
@anuraaga anuraaga changed the title Don't yield messages on GeneratorExit in sync server Avoid yielding messages on GeneratorExit in sync server Jan 21, 2026
@anuraaga anuraaga mentioned this pull request Jan 21, 2026
@anuraaga anuraaga merged commit 5b19cc2 into connectrpc:main Jan 22, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants